package com.dailyblue.java.project.bookstore.author.controller;

import com.dailyblue.java.project.bookstore.author.service.AuthorService;
import com.dailyblue.java.project.bookstore.author.util.JsonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/author")
public class AuthorController {
    @Resource
    private AuthorService authorService;

    @GetMapping("/{id}")
    public JsonResult findAuthorById(@PathVariable("id") int id) {
        return authorService.findAuthorById(id);
    }
}
